﻿using Kiiro.Common.Utility;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Kiiro.UnitTests
{
    /// <summary>
    ///This is a test class for KiiroEncryptionTest and is intended
    ///to contain all KiiroEncryptionTest Unit Tests
    ///</summary>
    [TestClass ( )]
    public class KiiroEncryptionTest
    {
        public TestContext TestContext
        {
            get;
            set;
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        public string TripleDESEncrypt ( )
        {
            return KiiroEncryption.Instance.TripleDESEncrypt ( "OpenProjects|1;ActiveUsers|1;Expires|" );
        }


        /// <summary>
        ///A test for TripleDESEncrypt
        ///</summary>
        [TestMethod ( )]
        public void TripleDESEncryptTest ( )
        {
            Assert.AreEqual ( "b1e960c1ff33f176cb7c2bb3d8c0382e0fa11b21a14bfa5b677f0e3f78414777", TripleDESEncrypt ( ) );
        }

        private string TripleDESDecrypt ( )
        {
            return KiiroEncryption.Instance.TripleDESDecrypt ( "b1e960c1ff33f176cb7c2bb3d8c0382e0fa11b21a14bfa5b677f0e3f78414777" );
        }

        /// <summary>
        ///A test for TripleDESDecrypt
        ///</summary>
        [TestMethod ( )]
        public void TripleDESDecryptTest ( )
        {
            Assert.AreEqual ( "OpenProjects|1;ActiveUsers|1", TripleDESDecrypt() );
        }



        [TestMethod ( )]
        public void DO ( )
        {
            Microsoft.SharePoint.Deployment.SPExport export = new Microsoft.SharePoint.Deployment.SPExport ( new System.Uri ( "http://nform-wss-cs" ), "c:/export" );
            export.Run ( );
        }
    }
}

/*************************************************************************
 * 
 * $Log: /Internal Projects/Kiiro/Kiiro.UnitTests/KiiroEncryptionTest.cs $
 * 
 * 6     28/09/09 10:13a Camerons
 * 
 * 5     9/09/09 1:08p Camerons
 * 
 * 4     17/08/09 10:45a Camerons
 * Added check-in comments section
 * 
 ************************************************************************/